<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>键盘按键次数</title>
</head>
<body>
    输入内容: <input type="text" name="" id="">
    <p>按键的次数：<span>0</span></p>
</body>
<script src="jquery.min.js"></script>
<script>
    i = 0;
    $(document).ready(function(){
        $("input").keypress(function(){ 
            //  i = i + 1
            // 获取当前键盘回车操作记数功能
            $("span").text(i+=1);
        })
    })
</script>
</html>